package com.zxy.supplier_system.server.entity

import jakarta.persistence.*
import java.io.Serializable

@Entity
@IdClass(EmployeeRole.UnionId::class)
class EmployeeRole {

    data class UnionId(
        var role:Int = 0,
        var employee:Int = 0,
    ):Serializable

    @Id
    @ManyToOne(optional = false)
    @JoinColumn
    lateinit var employee:Employee

    @Id
    @ManyToOne(optional = false)
    @JoinColumn
    lateinit var role:Role

}